package tcu.iot.gasmanage.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tcu.iot.gasmanage.common.Result;
import tcu.iot.gasmanage.service.BaiduMapService;

import javax.annotation.Resource;

@Api(value = "百度地图控制器")
@RestController
@RequestMapping("/baiduMap")
@CrossOrigin
public class BaiduMapController {

    @Resource
    private BaiduMapService baiduMapService;

    @ApiOperation(value = "/getAllCoordinates", notes = "获得所有坐标数据，连线使用")
    @GetMapping("/getAllCoordinates")
    public Result getAllCoordinates() {
        return baiduMapService.getAllMapData();
    }

    @ApiOperation(value = "/getAllPointsInfo",notes = "获取所有点位和设备信息")
    @GetMapping("/getAllPointsInfo")
    public Result getAllPointsInfo(){
        return baiduMapService.getAllPointsInfo();
    }
}
